//
//  PupilsCollectionViewCell.m
//  OneDoller
//
//  Created by jt on 16/8/16.
//  Copyright © 2016年 jyj. All rights reserved.
//

#import "PupilsCollectionViewCell.h"

@implementation PupilsCollectionViewCell
- (id) initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        
//        内容的图片
        
        self.imageV = [[UIImageView alloc]initWithFrame:CGRectMake(7, 7, CGRectGetWidth(self.frame)-14, CGRectGetWidth(self.frame)-30)];
        self.imageV.backgroundColor =[UIColor groupTableViewBackgroundColor];
        [self addSubview:self.imageV];
        
//        第多少期，多少期的内容
        
        self.productLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, CGRectGetMaxY(self.imageV.frame)+5, CGRectGetWidth(self.frame)-20, 20)];
        self.productLabel.font = [UIFont boldSystemFontOfSize:18];
        self.productLabel.font = [UIFont fontWithName:@ "Arial" size:17.0];
        self.productLabel.textColor = [UIColor grayColor];
        [self addSubview:self.productLabel];
        
//        剩余次数的进度条
        
        self.ProgressView = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleDefault];
        self.ProgressView.frame = CGRectMake(10, CGRectGetMaxY(self.productLabel.frame) + 5,CGRectGetWidth(self.frame)-20 ,20);
        //        设置进度条颜色
        self.ProgressView.trackTintColor = [UIColor grayColor];
        //        设置进度条上颜色
        self.ProgressView.progressTintColor = [UIColor greenColor];
        [self addSubview:self.ProgressView];
        
//        剩余次数
        
        self.surplusNumber = [[UILabel alloc] initWithFrame:CGRectMake(10, CGRectGetMaxY(self.ProgressView.frame)+5, CGRectGetWidth(self.frame)-20, 20)];
        self.surplusNumber.font = [UIFont boldSystemFontOfSize:18];
        self.surplusNumber.font = [UIFont fontWithName:@ "Arial" size:17.0];
        self.surplusNumber.textColor = [UIColor grayColor];
        [self addSubview:self.surplusNumber];

    }
    return self;
}

@end
